import request from '../utils/request.js'

// 获取新闻列表（1 企业新闻 2专题活动 3维保资料 4 公示文件）
export const getNews = (data) => {
  return request.get(
    '/article/list',
    data
  )
}
// 获取新闻详情
export const getDetail = (id) => {
  return request.get(
    '/article/' + id,
  )
}

// 新闻收藏
export const postArticle = (data) => {
  return request.post(
    '/user/collect/article',
    data,
  )
}

// 取消新闻收藏
export const postCancel = (data) => {
  return request.post(
    '/user/collect/cancelarticle',
    data,
  )
}


// 搜索新闻列表 params
export const searchNews = (data) => {
  return request('/search',
    data
  )
}
// 文章列表
export const getArticleList = (query) => {
  return request.get('/article/list')
}

// 搜索 params


export const getSearch = (data) => {
  return request.post('/search', data,{jsonType:2})
}

// 获取专题详情
export const getTopic = (id) => {
  return request.get('/topic/' + id, )
}

// 专题活动报名
export const postEnroll = (data) => {
  return request.post('/topic/enroll', data)
}

